package com.lagou.tomcat.servlet;

import com.lagou.tomcat.http.Request;
import com.lagou.tomcat.http.Response;

/**
 * 创建人: yyn
 * 创建时间:2021/9/5 18:01
 */
public abstract class HttpServlet implements Servlet {

    protected abstract void doGet(Request request, Response response);

    protected abstract void doPost(Request request, Response response);


    public void doService(Request request, Response response) {
        if (request.getMethod().equals("GET")) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    public void init() {

    }
}
